home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / nt_dsp1.lzh / NT_DSP1.MSA / LFLTS / LATNRM.ASM < prev    next >
Assembly Source File  |  1989-01-24  |  1KB  |  42 lines

  1. ;
  2. ; This program originally available on the Motorola DSP bulletin board.
  3. ; It is provided under a DISCLAMER OF WARRANTY available from
  4. ; Motorola DSP Operation, 6501 Wm. Cannon Drive W., Austin, Tx., 78735.
  5. ; Normalized Lattice IIR Filter Macro.
  6. ; Last Update 01 Aug 86   Version 1.0
  7. ;
  8. latnrm  macro   order
  9. latnrm  ident   1,0
  10. ;
  11. ;       Normalized Lattice filter macro
  12. ;
  13. ;       Input value in register y0, output value in register A
  14. ;
  15. ;       Macro call:
  16. ;               latnrm  order           ;call macro
  17. ;
  18. ;       where 'order' is the number of reflections coefficients
  19. ;       in the filter.
  20. ;
  21. ;       Alters registers: x0 x1 y0 y1 a b, r0 r4, pc sr
  22. ;
  23. ;       Uses 2 locations on stack
  24. ;
  25. ;
  26.   move           x:(r0)+,x1               ;get first Q in table
  27.   do    #order,_endnlat
  28.   mpy   x1,y0,a  x:(r0)+,x0   y:(r4),y1   ;q*w, get k, get s
  29.   macr -x0,y1,a  b,y:(r4)+                ;a-k*s, save new s
  30.   mpy   x0,y0,b               a,y0        ;k*w, set new w
  31.   macr  x1,y1,b  x:(r0)+,x1               ;b+q*s, get next q
  32. _endnlat              
  33.   move                        b,y:(r4)+   ;sv scnd lst st
  34.   move                        a,y:(r4)+   ;save last state
  35.   clr   a                     y:(r4)+,y0  ;clr acc, get fst st
  36.   rep   #order                            ;do fir taps
  37.   mac   x1,y0,a  x:(r0)+,x1   y:(r4)+,y0
  38.   macr  x1,y0,a               (r4)+       ;lst tap, rnd, adj pointer
  39.   endm
  40.